/*
* jlb
*/
package com.jlb.user.entity;

/**
 * 用户 的实体类的状态
 * 状态:激活 Active，冻结 Frozen，删除 Delete
 *
 * @author jlb
 */
public enum UserState implements java.io.Serializable {
    Active("激活"),
    Frozen("冻结"),
    Delete("删除"),;

    public String val;

    UserState(String val) {
        this.val = val;
    }

    /**
     * 根据状态名称查询状态
     *
     * @param stateName
     * @return
     */
    public static UserState getEnum(String stateName) {
        for (UserState userState : UserState.values()) {
            if (userState.name().equalsIgnoreCase(stateName)) {
                return userState;
            }
        }
        return null;
    }

    @Override
    public String toString() {
        return this.name();
    }

}
